Skip to content

test: validate ANSI escape codes are not in redirected composer output#134

Merged
AaronFeledy merged 3 commits intomainfrom
test/ansi-escape-codes
Feb 28, 2026
Merged

test: validate ANSI escape codes are not in redirected composer output#134
AaronFeledy merged 3 commits intomainfrom
test/ansi-escape-codes

Conversation

@AaronFeledy
Copy link
Copy Markdown
Member

@AaronFeledy AaronFeledy commented Feb 27, 2026

Adds a test that verifies lando composer --version > file.txt does not contain ANSI escape codes in the output file.

This test is expected to FAIL on CI until the fix is applied — removing --ansi from the composer tooling command.

The root cause is --ansi being hardcoded in the composer tooling definition. Composer auto-detects TTY when --ansi isn't forced.

Ref lando/drupal#157


Note

Low Risk
Low risk change to the default composer tooling command plus a test/doc check; main risk is minor output formatting differences for users relying on forced color.

Overview
Prevents ANSI escape codes from appearing in redirected lando composer output by removing the hardcoded --ansi flag from the WordPress recipe’s default composer tooling command.

Adds a verification step to the wordpress-defaults example to assert redirected composer --version output contains no ANSI sequences, and documents the change in CHANGELOG.md.

Written by Cursor Bugbot for commit 86cceaa. This will update automatically on new commits. Configure here.

Adds a test to verify that `lando composer` output does not contain
ANSI escape codes when stdout is redirected to a file.

This test is expected to FAIL until the fix is applied (removing
`--ansi` from the composer tooling command).

Ref lando/drupal#157
@netlify
Copy link
Copy Markdown

netlify bot commented Feb 27, 2026

Deploy Preview for lando-wordpress ready!

Name Link
🔨 Latest commit 86cceaa
🔍 Latest deploy log https://app.netlify.com/projects/lando-wordpress/deploys/69a234b4216c860008aa15be
😎 Deploy Preview https://deploy-preview-134--lando-wordpress.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 90 (🔴 down 3 from production)
Accessibility: 96 (no change from production)
Best Practices: 100 (no change from production)
SEO: 100 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify project configuration.

Composer auto-detects TTY and enables color output when appropriate.
The --ansi flag forced ANSI escape codes even when stdout was redirected
to a file or used in command substitution, breaking scripted usage.

Ref lando/drupal#157
@AaronFeledy AaronFeledy merged commit 99dfd2f into main Feb 28, 2026
34 checks passed
@AaronFeledy AaronFeledy deleted the test/ansi-escape-codes branch February 28, 2026 02:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant